home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / Put in (AppleScripts) folder / Recompile For 6.0.1 => 7 next >
Encoding:
Text File  |  1994-06-16  |  7.9 KB  |  210 lines  |  [TEXT/ToyS]

  1. tell application "THINK Project Manager"
  2.     activate
  3.     
  4.     -- Modification Ph. Casgrain
  5.     -- This extracts the full path to the THINK Project Manager folder
  6.     -- with a little song and dance...
  7.     try
  8.         set projectManager to (choose file of type "APPL" with prompt ¬
  9.             "Please locate the THINK Project Manager:") as string
  10.         set oldDelims to text item delimiters of AppleScript
  11.         set text item delimiters of AppleScript to {":"}
  12.         
  13.         set projectManagerPath to ""
  14.         repeat with i from 1 to ((count of text items in projectManager) - 1)
  15.             set projectManagerPath to projectManagerPath & (text item i of projectManager) & ":"
  16.         end repeat
  17.         
  18.         set text item delimiters of AppleScript to oldDelims
  19.     on error
  20.         set text item delimiters of AppleScript to oldDelims
  21.     end try
  22.     
  23.     
  24.     -- Modification Ph. Casgrain
  25.     -- Ask if the user has the C++ Libraries
  26.     set libraryChoice to button returned of (¬
  27.         display dialog "Do you have Symantec C++ or just plain C?" ¬
  28.             buttons {"C++", "Plain C"})
  29.     set doCPlusPlus to (libraryChoice = "C++")
  30.     
  31.     set RePrecompileFolderName to "(AppleScripts):"
  32.     
  33.     -- Modification Ph. Casgrain
  34.     if doCPlusPlus then
  35.         set RePrecompileProjectName to "RePrecompile++ π"
  36.     else
  37.         set RePrecompileProjectName to "RePrecompile π"
  38.     end if
  39.     
  40.     -- RECOMPILE THE FOURTEEN STANDARD LIBRARIES
  41.     
  42.     set thisFolderName to "Standard Libraries:"
  43.     
  44.     set thisProjectName to "ANSI"
  45.     open file (projectManagerPath & thisFolderName & thisProjectName)
  46.     compile project document 1
  47.     close project document thisProjectName saving «constant enumyes » with compacting
  48.     
  49.     set thisProjectName to "ANSI—A4"
  50.     open file (projectManagerPath & thisFolderName & thisProjectName)
  51.     compile project document 1
  52.     close project document thisProjectName saving «constant enumyes » with compacting
  53.     
  54.     set thisProjectName to "ANSI—small"
  55.     open file (projectManagerPath & thisFolderName & thisProjectName)
  56.     compile project document 1
  57.     close project document thisProjectName saving «constant enumyes » with compacting
  58.     
  59.     set thisProjectName to "profile"
  60.     open file (projectManagerPath & thisFolderName & thisProjectName)
  61.     compile project document 1
  62.     close project document thisProjectName saving «constant enumyes » with compacting
  63.     
  64.     set thisProjectName to "unix"
  65.     open file (projectManagerPath & thisFolderName & thisProjectName)
  66.     compile project document 1
  67.     close project document thisProjectName saving «constant enumyes » with compacting
  68.     
  69.     -- Modification Ph. Casgrain
  70.     if doCPlusPlus then
  71.         set thisProjectName to "ANSI++"
  72.         open file (projectManagerPath & thisFolderName & thisProjectName)
  73.         compile project document 1
  74.         close project document thisProjectName saving «constant enumyes » with compacting
  75.  
  76.         set thisProjectName to "ANSI—A4++"
  77.         open file (projectManagerPath & thisFolderName & thisProjectName)
  78.         compile project document 1
  79.         close project document thisProjectName saving «constant enumyes » with compacting
  80.  
  81.         set thisProjectName to "ANSI—small++"
  82.         open file (projectManagerPath & thisFolderName & thisProjectName)
  83.         compile project document 1
  84.         close project document thisProjectName saving «constant enumyes » with compacting
  85.         
  86.         set thisProjectName to "complex"
  87.         open file (projectManagerPath & thisFolderName & thisProjectName)
  88.         compile project document 1
  89.         close project document thisProjectName saving «constant enumyes » with compacting
  90.         
  91.         set thisProjectName to "CPlusLib"
  92.         open file (projectManagerPath & thisFolderName & thisProjectName)
  93.         compile project document 1
  94.         close project document thisProjectName saving «constant enumyes » with compacting
  95.         
  96.         set thisProjectName to "CPlusLib-A4"
  97.         open file (projectManagerPath & thisFolderName & thisProjectName)
  98.         compile project document 1
  99.         close project document thisProjectName saving «constant enumyes » with compacting
  100.  
  101.         set thisProjectName to "profile++"
  102.         open file (projectManagerPath & thisFolderName & thisProjectName)
  103.         compile project document 1
  104.         close project document thisProjectName saving «constant enumyes » with compacting
  105.  
  106.         set thisProjectName to "unix++"
  107.         open file (projectManagerPath & thisFolderName & thisProjectName)
  108.         compile project document 1
  109.         close project document thisProjectName saving «constant enumyes » with compacting
  110.         
  111.         -- IOStreams uses unix++, so must be brought up to date after the unix++ project
  112.         set thisProjectName to "IOStreams"
  113.         open file (projectManagerPath & thisFolderName & thisProjectName)
  114.         compile project document 1
  115.         close project document thisProjectName saving «constant enumyes » with compacting
  116.     end if -- if doCPlusPlus
  117.     
  118.     -- RECOMPILE THE ONE MAC LIBRARY
  119.     
  120.     set thisFolderName to "Mac Libraries:"
  121.     
  122.     set thisProjectName to "SANE"
  123.     open file (projectManagerPath & thisFolderName & thisProjectName)
  124.     compile project document 1
  125.     close project document thisProjectName saving «constant enumyes » with compacting
  126.     
  127.     
  128.     -- RECOMPILE THE TEN OOPS LIBRARIES
  129.     
  130.     set thisFolderName to "oops Libraries:"
  131.     
  132.     set thisProjectName to "oops"
  133.     open file (projectManagerPath & thisFolderName & thisProjectName)
  134.     compile project document 1
  135.     close project document thisProjectName saving «constant enumyes » with compacting
  136.     
  137.     set thisProjectName to "oopsA4"
  138.     open file (projectManagerPath & thisFolderName & thisProjectName)
  139.     compile project document 1
  140.     close project document thisProjectName saving «constant enumyes » with compacting
  141.     
  142.     set thisProjectName to "oopsDebug"
  143.     open file (projectManagerPath & thisFolderName & thisProjectName)
  144.     compile project document 1
  145.     close project document thisProjectName saving «constant enumyes » with compacting
  146.     
  147.     set thisProjectName to "oopsDebugFar"
  148.     open file (projectManagerPath & thisFolderName & thisProjectName)
  149.     compile project document 1
  150.     close project document thisProjectName saving «constant enumyes » with compacting
  151.     
  152.     set thisProjectName to "oopsFar"
  153.     open file (projectManagerPath & thisFolderName & thisProjectName)
  154.     compile project document 1
  155.     close project document thisProjectName saving «constant enumyes » with compacting
  156.     
  157.     -- Modification Ph. Casgrain
  158.     if doCPlusPlus then
  159.         set thisProjectName to "oops++"
  160.         open file (projectManagerPath & thisFolderName & thisProjectName)
  161.         compile project document 1
  162.         close project document thisProjectName saving «constant enumyes » with compacting
  163.  
  164.         set thisProjectName to "oopsA4++"
  165.         open file (projectManagerPath & thisFolderName & thisProjectName)
  166.         compile project document 1
  167.         close project document thisProjectName saving «constant enumyes » with compacting
  168.  
  169.         set thisProjectName to "oopsDebug++"
  170.         open file (projectManagerPath & thisFolderName & thisProjectName)
  171.         compile project document 1
  172.         close project document thisProjectName saving «constant enumyes » with compacting
  173.  
  174.         set thisProjectName to "oopsDebugFar++"
  175.         open file (projectManagerPath & thisFolderName & thisProjectName)
  176.         compile project document 1
  177.         close project document thisProjectName saving «constant enumyes » with compacting
  178.  
  179.         set thisProjectName to "oopsFar++"
  180.         open file (projectManagerPath & thisFolderName & thisProjectName)
  181.         compile project document 1
  182.         close project document thisProjectName saving «constant enumyes » with compacting
  183.     end if -- if doCPlusPlus
  184.     
  185.     -- RE-PRECOMPILE THE TWO PRECOMPILED HEADERS
  186.     
  187.     -- first, just open our project so we can open the text files
  188.     open file (projectManagerPath & RePrecompileFolderName & RePrecompileProjectName)
  189.     
  190.     -- now, precompile its source text files
  191.     set thisFolderName to "Mac #includes:"
  192.     set i to 1
  193.     repeat while (i ≤ the (count of source of project document 1))
  194.         copy (a reference to source i of project document 1) to thisSource
  195.         copy ":" to thePrecompiledFileName
  196.         if the name of thisSource is "Mac #includes.c" then
  197.             copy "MacHeaders" to thePrecompiledFileName
  198.         else if the name of thisSource is "Mac #includes.cp" or the name of thisSource is "Mac #includes.cpp" then
  199.             copy "MacHeaders++" to thePrecompiledFileName
  200.         end if
  201.         if thePrecompiledFileName is not ":" then
  202.             precompile thisSource to projectManagerPath & thisFolderName & thePrecompiledFileName with making
  203.         else
  204.             precompile thisSource with making
  205.         end if
  206.         set i to i + 1
  207.     end repeat
  208.     
  209. end tell
  210.